package binary;
/**补码演示*/
public class ComplementDemo {
    public static void main(String[] args) {

       /*
      //规律数
      int max = Integer.MAX_VALUE;
      int min = Integer.MIN_VALUE;
      System.out.println(Integer.toBinaryString(max));  //01111111111111111111111111111111
      System.out.println(Integer.toBinaryString(min));  //10000000000000000000000000000000
      System.out.println(Integer.toBinaryString(-1)); //11111111111111111111111111111111
      System.out.println(Integer.toBinaryString(0));  //00000000000000000000000000000000
        */


        int n =-45;
        System.out.println(Integer.toBinaryString(n));
        System.out.println(n);


    }
}
